<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8" />
    <title>详细--{APP_NAME}</title>
    <link rel="stylesheet" href="{RESOURCES_PATH}/editor.md/css/style.css" />
    <link rel="stylesheet" href="{RESOURCES_PATH}/editor.md/css/editormd.preview.css" />
    <link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" />

    <style>
        body {padding: 40px;}

        #layout > header {
            width: auto;
        }

        #sidebar {
            width: 480px;
            height: 100%;
            position: fixed;
            top: 0;
            right: 0;
            overflow: hidden;
            background: #fff;
            z-index: 100;
            padding: 18px;
            border: 1px solid #ddd;
            border-top: none;
            border-bottom: none;
        }

        #sidebar:hover {
            overflow: auto;
        }

        #sidebar h1 {
            font-size: 16px;
        }

        #custom-toc-container {
            padding-left: 0;
        }

        #test-editormd-view {
            padding-left: 0;
            padding-right: 480px;
            margin: 0;
        }
    </style>
</head>
<body>
<div id="layout">
    <div id="sidebar">
        <div class="markdown-body editormd-preview-container" id="custom-toc-container">#custom-toc-container</div>
    </div>
    <div id="test-editormd-view">
        <textarea style="display:none;" name="test-editormd-markdown-doc"></textarea>
    </div>
</div>
<!--
<script src="js/zepto.min.js"></script>
<script>
    var jQuery = Zepto;  // 为了避免修改flowChart.js和sequence-diagram.js的源码，所以使用Zepto.js时想支持flowChart/sequenceDiagram就得加上这一句
</script>
 -->
<script src="{RESOURCES_PATH}/editor.md/js/jquery.min.js"></script>
<script src="{RESOURCES_PATH}/editor.md/lib/marked.min.js"></script>
<script src="{RESOURCES_PATH}/editor.md/lib/prettify.min.js"></script>

<script src="{RESOURCES_PATH}/editor.md/lib/raphael.min.js"></script>
<script src="{RESOURCES_PATH}/editor.md/lib/underscore.min.js"></script>
<script src="{RESOURCES_PATH}/editor.md/lib/sequence-diagram.min.js"></script>
<script src="{RESOURCES_PATH}/editor.md/lib/flowchart.min.js"></script>
<script src="{RESOURCES_PATH}/editor.md/lib/jquery.flowchart.min.js"></script>

<script src="{RESOURCES_PATH}/editor.md/editormd.js"></script>
<script type="text/javascript">
    var site_url = "{url(['act' => 'login', 'mod' => 'Site'])}";
</script>
<script src="{RESOURCES_PATH}/static/js/request.js"></script>

<script type="text/javascript">

    $(function() {
        doRequest('POST', "{url(['act' => 'note', 'action' => 'getNote', 'id' => $_GET['id'] ?? 0])}", {}).then(function (markdown) {
            console.log('3', 3);
            editormd.markdownToHTML("test-editormd-view", {
                markdown        : markdown.data.content ,//+ "\r\n" + $("#append-test").text(),
                //htmlDecode      : true,       // 开启 HTML 标签解析，为了安全性，默认不开启
                htmlDecode      : "style,script,iframe",  // you can filter tags decode
                //toc             : false,
                tocm            : true,    // Using [TOCM]
                tocContainer    : "#custom-toc-container", // 自定义 ToC 容器层
                //gfm             : false,
                //tocDropdown     : true,
                // markdownSourceCode : true, // 是否保留 Markdown 源码，即是否删除保存源码的 Textarea 标签
                emoji           : true,
                taskList        : true,
                tex             : true,  // 默认不解析
                flowChart       : true,  // 默认不解析
                sequenceDiagram : true,  // 默认不解析
            });
        });
    });
</script>
</body>
</html>